<include file="Public:headersmall"/>
<style>
.center{width:1000px;margin:0 auto;margin-top:10px}
.left{width:160px;border:1px solid #dddddd;float:left;}
.main{width:830px;float:right;}
.title2{display:block;background:#317ee7;color:#fff;text-align:left;font-size:16px;height:25px;line-height:25px}
.left dl{display:block;background:#fff;font-size:13px;height:25px;line-height:25px}
.help{margin-top:5px}
input{padding:5px}
tr{ height:40px}
</style>
<div class="center">您的位置：<a href="__APP__">首页</a>-><a href="__GROUP__/Member"><font color="#317ee7">会员中心</font></a></div>
<div class="center">
   <div class="left">
    <include file="left"/>
   </div>

   <div class="main">
		   <table border="0" width="100%" id="table1">
			<tr>
				<td align="right">旧密码:</td>
				<td><input type="password" name="old_pwd" size="20"></td>
			</tr>
			<tr>
				<td align="right">新密码：</td>
				<td><input type="password" name="new_pwd" size="20"></td>
			</tr>
			<tr>
				<td align="right">确认新密码：</td>
				<td><input type="password" name="re_pwd" size="20"></td>
			</tr>
			<tr>
				<td align="right">　</td>
				<td><input type="text" name="member_id" value="{$member.member_id}" style="display:none"></td>
			</tr>
			<tr>
				<td align="right" colspan="2">
				<p align="center"><input type="button" id="save" value="保存修改" name="B1"></td>
			</tr>
		</table>
   </div>
</div>

<script>
$("#save").click(function(){
    var member_id=$("[name=member_id]").val();
	var old_pwd=$("[name=old_pwd]").val();
	var new_pwd=$("[name=new_pwd]").val();
	var re_pwd=$("[name=re_pwd]").val();

	if(new_pwd!=re_pwd){
			jError("<strong>两次密码不一致！</strong>",{TimeShown : 500,VerticalPosition : 'center',HorizontalPosition : 'center'})
			$("[name=re_pwd]").val('');
			$("[name=re_pwd]").focus();
	}else{

			$.ajax({
				type:"POST",
				url:"__URL__/change_pwd/?action=save",
				dataType:"json",
				data:{'member_id':member_id,'old_pwd':old_pwd,'new_pwd':new_pwd},
				success:function(data){
					 if(data==1){
						 jError("<strong>旧密码不正确！</strong>",{TimeShown : 500,VerticalPosition : 'center',HorizontalPosition : 'center',onClosed:function(){location.reload();}})
					}else if(data==2){
						 jSuccess("<strong>修改成功！</strong>",{TimeShown : 500,VerticalPosition : 'center',HorizontalPosition : 'center',onClosed:function(){window.parent.location.reload();}})
					}
				}
			})
	}
})
</script>

<link rel="stylesheet" type="text/css" href="__APP__/statics/css/jNotify.jquery.css" />
<script type="text/javascript" src="__APP__/statics/jNotify.jquery.js"></script>
<div style="clear:both"></div>
<br>
<include file="Public:footersmall"/>